package api.flinkapi.apidemos;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/***
 * @author hunter.d
 * @qq 657270652
 * @wx haitao-duan
 * @date 2021/7/25
 **/
public class TestRegexp {
    public static void main(String[] args) {
        String s = "ABCAAFCFA";
        String p = "(A(?!B).*C.*?F)";
        Pattern r = Pattern.compile(p);
        Matcher matcher = r.matcher(s);
        int count = 0;
        while(matcher.find()) count++;
        System.out.println(count);
    }
}
